<?php

/**
 *  后台菜单
 */
namespace app\admin\model;

class Menu extends BaseModel
{

    /**
     *  权限列表
    */
    public function permission()
    {
        return $this->hasMany(Menu::class,'parent_id','id');
    }

    /**
     *  获取父级菜单
    */
    public function parent()
    {
        return $this->hasOne(Menu::class,'id','parent_id');
    }



}
